\hypertarget{classcUnivarPolynomial}{\section{c\-Univar\-Polynomial$<$ T $>$ Class Template Reference}
\label{classcUnivarPolynomial}\index{c\-Univar\-Polynomial$<$ T $>$@{c\-Univar\-Polynomial$<$ T $>$}}
}


{\ttfamily \#include $<$univar\-\_\-polynomial.\-h$>$}



Collaboration diagram for c\-Univar\-Polynomial$<$ T $>$\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=208pt]{classcUnivarPolynomial__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcUnivarPolynomial_a4ff2b63bc58ec4ab56f270237caf6f0b}{{\bfseries c\-Univar\-Polynomial} (std\-::size\-\_\-t tolerance=std\-::numeric\-\_\-limits$<$ T $>$\-::digits)}\label{classcUnivarPolynomial_a4ff2b63bc58ec4ab56f270237caf6f0b}

\item 
\hypertarget{classcUnivarPolynomial_a967378cb72bc82a047800e9b52051ccd}{{\bfseries c\-Univar\-Polynomial} (const std\-::vector$<$ T $>$ \&coefficients, std\-::size\-\_\-t tolerance=std\-::numeric\-\_\-limits$<$ T $>$\-::digits)}\label{classcUnivarPolynomial_a967378cb72bc82a047800e9b52051ccd}

\item 
\hypertarget{classcUnivarPolynomial_aa32abc2e773a74b65e960a24cf65f70b}{{\bfseries c\-Univar\-Polynomial} (const T $\ast$data, std\-::size\-\_\-t degree, std\-::size\-\_\-t tolerance=std\-::numeric\-\_\-limits$<$ T $>$\-::digits)}\label{classcUnivarPolynomial_aa32abc2e773a74b65e960a24cf65f70b}

\item 
\hypertarget{classcUnivarPolynomial_adbabe3b2fa5052c19f87327de092c8fb}{size\-\_\-t {\bfseries size} () const }\label{classcUnivarPolynomial_adbabe3b2fa5052c19f87327de092c8fb}

\item 
\hypertarget{classcUnivarPolynomial_ad4b0b24cc9229a9b96eb71e224db8c03}{size\-\_\-t {\bfseries degree} () const }\label{classcUnivarPolynomial_ad4b0b24cc9229a9b96eb71e224db8c03}

\item 
\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ \hyperlink{classcUnivarPolynomial_af0fa0596f636515bcab1e2dedc2fde79}{derivative} () const 
\item 
\hypertarget{classcUnivarPolynomial_a9eabafc8d312e0fab838de2b488c3c0f}{\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ {\bfseries primitive} () const }\label{classcUnivarPolynomial_a9eabafc8d312e0fab838de2b488c3c0f}

\item 
\hypertarget{classcUnivarPolynomial_adc403a66d40a9f5689089ac401a71484}{\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ {\bfseries inverse} () const }\label{classcUnivarPolynomial_adc403a66d40a9f5689089ac401a71484}

\item 
std\-::vector$<$ double $>$ \hyperlink{classcUnivarPolynomial_a0d81e941a048c6ca649dd11d8a4cda8b}{real\-Zeros} () const 
\item 
std\-::vector$<$ std\-::pair$<$ double, \\*
double $>$ $>$ \hyperlink{classcUnivarPolynomial_abd186b4aab94bf19bf33796df810785e}{plot\-Points} (double min, double max, double increment) const 
\item 
\hypertarget{classcUnivarPolynomial_a43462afe158c1ee0f24633521de68615}{std\-::vector$<$ std\-::complex$<$ T $>$ $>$ {\bfseries complex\-Zeroes} () const }\label{classcUnivarPolynomial_a43462afe158c1ee0f24633521de68615}

\item 
\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ \& \hyperlink{classcUnivarPolynomial_a3aeaae886ae33ff00e9207847c68deb2}{operator\%=} (const \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial} \&poly)
\item 
\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ \& \hyperlink{classcUnivarPolynomial_a4158585d1768e886c6802030f6ec128f}{operator$\ast$=} (const \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial} \&poly)
\item 
\hypertarget{classcUnivarPolynomial_a835d683a23b47a5bd9c1958f1f8bf814}{\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ \& {\bfseries operator$\ast$=} (T num)}\label{classcUnivarPolynomial_a835d683a23b47a5bd9c1958f1f8bf814}

\item 
\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ \& \hyperlink{classcUnivarPolynomial_a60558f674dbadb2d18e3406f4d45da0e}{operator/=} (const \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial} \&poly)
\item 
\hypertarget{classcUnivarPolynomial_ab638a1b793b4f96315899672e77af6e5}{\hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ \& {\bfseries operator/=} (T divisor)}\label{classcUnivarPolynomial_ab638a1b793b4f96315899672e77af6e5}

\item 
{\footnotesize template$<$typename Y $>$ }\\T \hyperlink{classcUnivarPolynomial_a651a710f52fdd21136419d2c6fef5574}{operator()} (const Y \&value) const 
\item 
bool \hyperlink{classcUnivarPolynomial_a54e506b4fac4647cc8aad776ba131940}{operator==} (const \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial} \&poly) const 
\item 
std\-::vector$<$ \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}\\*
$<$ T $>$ $>$ \hyperlink{classcUnivarPolynomial_a936aa1a9e68b7005af72be0fbb2d91ac}{sturm\-Sequence} () const 
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcUnivarPolynomial_ae6d336689220ead8386c08aa5e7b540b}{static \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ T $>$ {\bfseries zero} ()}\label{classcUnivarPolynomial_ae6d336689220ead8386c08aa5e7b540b}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
std\-::vector$<$ double $>$ \& \hyperlink{classcUnivarPolynomial_a887727886c8d9ed3a789b10de1c50785}{solve\-R\-Quadratic} (std\-::vector$<$ double $>$ \&zeros) const 
\item 
std\-::vector$<$ double $>$ \& \hyperlink{classcUnivarPolynomial_a9203e9c2e0c7d1f4d70c13b08e37d5ff}{solve\-R\-Cubic} (std\-::vector$<$ double $>$ \&zeros) const 
\item 
int \hyperlink{classcUnivarPolynomial_a3faca94991f37531436883070bcc7f01}{sturm\-Signs\-No} (double x0) const 
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcUnivarPolynomial_a76cee4a4b33c7ca3b2b23b7310f937e0}{bmt\-::polynomial$<$ T $>$ {\bfseries m\-\_\-\-Poly\-Impl}}\label{classcUnivarPolynomial_a76cee4a4b33c7ca3b2b23b7310f937e0}

\item 
\hypertarget{classcUnivarPolynomial_a144f68114be5e7f026f40d44c8d5fedd}{bmt\-::eps\-\_\-tolerance$<$ T $>$ {\bfseries m\-\_\-\-Tolerance}}\label{classcUnivarPolynomial_a144f68114be5e7f026f40d44c8d5fedd}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcUnivarPolynomial_ad225ad139a5ce7b6a4cb685a219ed9ab}{{\footnotesize template$<$class Y $>$ }\\std\-::ostream \& {\bfseries operator$<$$<$} (std\-::ostream \&out, const \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ Y $>$ \&poly)}\label{classcUnivarPolynomial_ad225ad139a5ce7b6a4cb685a219ed9ab}

\item 
\hypertarget{classcUnivarPolynomial_a92998d9dc30249d38f164dc4ebc8abef}{{\footnotesize template$<$class Y $>$ }\\std\-::ostream \& {\bfseries operator$<$$<$} (std\-::ostream \&out, const std\-::pair$<$ \hyperlink{classcUnivarPolynomial}{c\-Univar\-Polynomial}$<$ Y $>$, \hyperlink{classcVariable}{c\-Variable} $>$ \&poly)}\label{classcUnivarPolynomial_a92998d9dc30249d38f164dc4ebc8abef}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename T$>$class c\-Univar\-Polynomial$<$ T $>$}

implements common operations on polynomials on top of B\-O\-O\-S\-T polynomial class ! poly\mbox{[}0\mbox{]} is the free term ! poly\mbox{[}degree\mbox{]} can't be zero -\/ the zero polynomial is the empty vector 

\subsection{Member Function Documentation}
\hypertarget{classcUnivarPolynomial_af0fa0596f636515bcab1e2dedc2fde79}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!derivative@{derivative}}
\index{derivative@{derivative}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{derivative}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$\-::derivative (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classcUnivarPolynomial_af0fa0596f636515bcab1e2dedc2fde79}
returns the derivative as a new polynomial \hypertarget{classcUnivarPolynomial_a3aeaae886ae33ff00e9207847c68deb2}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!operator\%=@{operator\%=}}
\index{operator\%=@{operator\%=}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{operator\%=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$ \& {\bf c\-Univar\-Polynomial}$<$ T $>$\-::operator\%= (
\begin{DoxyParamCaption}
\item[{const {\bf c\-Univar\-Polynomial}$<$ T $>$ \&}]{poly}
\end{DoxyParamCaption}
)}}\label{classcUnivarPolynomial_a3aeaae886ae33ff00e9207847c68deb2}
overload operator \% to compute the polynomial division remainder implements the algorithm from Knuth vol2 \hypertarget{classcUnivarPolynomial_a651a710f52fdd21136419d2c6fef5574}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!operator()@{operator()}}
\index{operator()@{operator()}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{operator()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T$>$ template$<$typename Y $>$ T {\bf c\-Univar\-Polynomial}$<$ T $>$\-::operator() (
\begin{DoxyParamCaption}
\item[{const Y \&}]{value}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcUnivarPolynomial_a651a710f52fdd21136419d2c6fef5574}
overload operator () to evaluate the polynomial \hypertarget{classcUnivarPolynomial_a4158585d1768e886c6802030f6ec128f}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!operator$\ast$=@{operator$\ast$=}}
\index{operator$\ast$=@{operator$\ast$=}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{operator$\ast$=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$ \& {\bf c\-Univar\-Polynomial}$<$ T $>$\-::operator$\ast$= (
\begin{DoxyParamCaption}
\item[{const {\bf c\-Univar\-Polynomial}$<$ T $>$ \&}]{poly}
\end{DoxyParamCaption}
)}}\label{classcUnivarPolynomial_a4158585d1768e886c6802030f6ec128f}
overload operator $\ast$ to compute the polynomial multiplication \hypertarget{classcUnivarPolynomial_a60558f674dbadb2d18e3406f4d45da0e}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!operator/=@{operator/=}}
\index{operator/=@{operator/=}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{operator/=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$ \& {\bf c\-Univar\-Polynomial}$<$ T $>$\-::operator/= (
\begin{DoxyParamCaption}
\item[{const {\bf c\-Univar\-Polynomial}$<$ T $>$ \&}]{poly}
\end{DoxyParamCaption}
)}}\label{classcUnivarPolynomial_a60558f674dbadb2d18e3406f4d45da0e}
overload operator / to compute the polynomial division quotient implements the algorithm from Knuth vol2 \hypertarget{classcUnivarPolynomial_a54e506b4fac4647cc8aad776ba131940}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!operator==@{operator==}}
\index{operator==@{operator==}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool {\bf c\-Univar\-Polynomial}$<$ T $>$\-::operator== (
\begin{DoxyParamCaption}
\item[{const {\bf c\-Univar\-Polynomial}$<$ T $>$ \&}]{poly}
\end{DoxyParamCaption}
) const}}\label{classcUnivarPolynomial_a54e506b4fac4647cc8aad776ba131940}
overload operator == to compute the polynomial equality \hypertarget{classcUnivarPolynomial_abd186b4aab94bf19bf33796df810785e}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!plot\-Points@{plot\-Points}}
\index{plot\-Points@{plot\-Points}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{plot\-Points}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\-::vector$<$ std\-::pair$<$ double, double $>$ $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$\-::plot\-Points (
\begin{DoxyParamCaption}
\item[{double}]{min, }
\item[{double}]{max, }
\item[{double}]{increment}
\end{DoxyParamCaption}
) const}}\label{classcUnivarPolynomial_abd186b4aab94bf19bf33796df810785e}
returns a list of points used to plot a graph of the polynomial uses adaptive sampling to compute more points near high curvature areas \hypertarget{classcUnivarPolynomial_a0d81e941a048c6ca649dd11d8a4cda8b}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!real\-Zeros@{real\-Zeros}}
\index{real\-Zeros@{real\-Zeros}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{real\-Zeros}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\-::vector$<$ double $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$\-::real\-Zeros (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classcUnivarPolynomial_a0d81e941a048c6ca649dd11d8a4cda8b}
returns the real zeros (double) of the polynomial \hypertarget{classcUnivarPolynomial_a9203e9c2e0c7d1f4d70c13b08e37d5ff}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!solve\-R\-Cubic@{solve\-R\-Cubic}}
\index{solve\-R\-Cubic@{solve\-R\-Cubic}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{solve\-R\-Cubic}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\-::vector$<$ double $>$ \& {\bf c\-Univar\-Polynomial}$<$ T $>$\-::solve\-R\-Cubic (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ double $>$ \&}]{zeros}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [private]}}}\label{classcUnivarPolynomial_a9203e9c2e0c7d1f4d70c13b08e37d5ff}
get real zeros when the polynomial is cubic -\/ using Cardano's formula \hypertarget{classcUnivarPolynomial_a887727886c8d9ed3a789b10de1c50785}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!solve\-R\-Quadratic@{solve\-R\-Quadratic}}
\index{solve\-R\-Quadratic@{solve\-R\-Quadratic}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{solve\-R\-Quadratic}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\-::vector$<$ double $>$ \& {\bf c\-Univar\-Polynomial}$<$ T $>$\-::solve\-R\-Quadratic (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ double $>$ \&}]{zeros}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [private]}}}\label{classcUnivarPolynomial_a887727886c8d9ed3a789b10de1c50785}
get real zeros when the function has the degree smaller or equal to 2 \hypertarget{classcUnivarPolynomial_a936aa1a9e68b7005af72be0fbb2d91ac}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!sturm\-Sequence@{sturm\-Sequence}}
\index{sturm\-Sequence@{sturm\-Sequence}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{sturm\-Sequence}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ std\-::vector$<$ {\bf c\-Univar\-Polynomial}$<$ T $>$ $>$ {\bf c\-Univar\-Polynomial}$<$ T $>$\-::sturm\-Sequence (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classcUnivarPolynomial_a936aa1a9e68b7005af72be0fbb2d91ac}
returns the Sturm sequence corresponding to the polynomial used to compute real zeros \hypertarget{classcUnivarPolynomial_a3faca94991f37531436883070bcc7f01}{\index{c\-Univar\-Polynomial@{c\-Univar\-Polynomial}!sturm\-Signs\-No@{sturm\-Signs\-No}}
\index{sturm\-Signs\-No@{sturm\-Signs\-No}!cUnivarPolynomial@{c\-Univar\-Polynomial}}
\subsubsection[{sturm\-Signs\-No}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ int {\bf c\-Univar\-Polynomial}$<$ T $>$\-::sturm\-Signs\-No (
\begin{DoxyParamCaption}
\item[{double}]{x0}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [private]}}}\label{classcUnivarPolynomial_a3faca94991f37531436883070bcc7f01}
get the number of sign changes of the sturm sequence in the point x0 

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
univar\-\_\-polynomial.\-h\item 
univar\-\_\-polynomial.\-cpp\end{DoxyCompactItemize}
